// OperatorOverLoading2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include  <iostream.h>
class counter
{
public:
	counter( ){v = 0;}
	counter operator ++( );
	counter operator ++(int);
	void print( ) {cout << v << endl;};

private:
	unsigned int v;
};

counter counter :: operator ++( )
{
	v++;
	return *this;
}

counter counter :: operator ++(int)
{
	counter  t;
	t.v = v++;
	return t;
}

void main( )
{
	counter c;
	for(int i = 0;  i < 8;  i++)
		c++;
	c.print( );

	for(i = 0;  i < 8;  i++)
		c.operator++(2);
	c.print( );
}


